BEAMHEAD
Compute ham radio beam heading and distance.
----begin documentation----
Program:  BEAMHEAD
Author:   John P. Powers (jpp@cpdvax.csc.ti.com)
Date:     December 1992

This program computes the direction to point your ham radio antenna
to get best reception of a distant ham radio.

Given your longitude and latitude and the longitude and latitude of
another location this program computes the compass direction and
distance in miles of the distant location.

Answer the program's prompts for latitude and longitude as a pair of
numbers in parentheses.  For example, the latitude and longitude of
Fairbanks, Alaska (65 degrees north, 147 degrees west) would be
entered as (65,147).  Southern latitudes and eastern longitudes are
entered as negative angles.

Store the latitudes and longitudes in variables to build up a data
base of city, country, and ham radio call sign locations.  For
example:

   (33,97)->Dallas
   (65,147)->Fairbank
   (47,71)->Quebec

The variable name of the location may then be entered at the prompt
for a location.

Example:  Compute the direction and distance from Dallas to
Fairbanks.

  BEAMHEAD
  Origin (lat,long): Dallas       --Use [VARS] <CPLX> to quickly
  Dest (lat,long): Fairbank       --look up and enter the city names.
  Dist=
          3026.08610281
  Bearing=
          332o7'36.687"

The great circle distance from Dallas to Fairbanks is 3026 miles with
a bearing of 332 degrees.
----end documentation----
----begin ascii----
\START\
\COMMENT=Distance and direction between cities     
\NAME=BEAMHEAD
\FILE=beamhead.85P
Degree
Input "Origin (lat,long): ",ORIG
Input "Dest (lat,long): ",DEST
real ORIG\->\OLAT
imag ORIG\->\OLNG
real DEST\->\DLAT
imag DEST\->\DLNG
(\cos^-1\ (sin OLAT*sin DLAT+cos OLAT*cos DLAT*cos (DLNG-OLNG))*60) nmi\#\
le\>\mile\->\DIST
Disp "Dist=",DIST
OLNG-DLNG\->\LNG
\tan^-1\ (cos LNG/tan DLAT)\->\AA
\tan^-1\ (1/((cos (OLAT+AA)/tan LNG)/sin AA))\->\AZ
If AZ<0:AZ+360\->\AZ
Disp "Bearing=",AZ\>DMS\
\STOP\
----end ascii----
----begin uue----
begin 644 beamhead.85p
M*BI423@U*BH:#`!$:7-T86YC92!A;F0@9&ER96-T:6]N(&)E='=E96X@8VET
M:65S("`@("!V`0P`9@$2"$)%04U(14%$9@%D`0!$96=R967626YP=70@(D]R
M:6=I;B`H;&%T+&QO;F<I.B`B+$]224?626YP=70@(D1E<W0@*&QA="QL;VYG
M*3H@(BQ$15-4UG)E86P@3U))1QQ/3$%4UFEM86<@3U))1QQ/3$Y'UG)E86P@
M1$535!Q$3$%4UFEM86<@1$535!Q$3$Y'UBAC;W,1("AS:6X@3TQ!5"IS:6X@
M1$Q!5"MC;W,@3TQ!5"IC;W,@1$Q!5"IC;W,@*$1,3D<M3TQ.1RDI*C8P*2!N
M;6EL905M:6QE'$1)4U361&ES<"`B1&ES=#TB+$1)4U363TQ.1RU$3$Y''$Q.
M1]9T86X1("AC;W,@3$Y'+W1A;B!$3$%4*1Q!0=9T86X1("@Q+R@H8V]S("A/
M3$%4*T%!*2]T86X@3$Y'*2]S:6X@04$I*1Q!6M9)9B!!6CPP.D%:*S,V,!Q!
:6M9$:7-P(")"96%R:6YG/2(L05H%1$U35W(`
`
end
----end uue----
